/* Basic editor styles */
.tiptap {
  outline: none;
  height: calc(100% - 100px);
  overflow-y: scroll;
  font-size: 0.9rem;
  font-weight: 500;

  :first-child {
    margin-top: 0;
  }

  /* Heading styles */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    line-height: 1.1;
    margin-top: 2.5rem;
    text-wrap: pretty;
  }

  h1,
  h2 {
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
  }

  h1 {
    font-size: 1.4rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  h3 {
    font-size: 1.1rem;
  }

  h4,
  h5,
  h6 {
    font-size: 1rem;
  }

  /* Code and preformatted text styles */
  code {
    background-color: var(--purple-light);
    border-radius: 0.4rem;
    color: var(--xz-black);
    font-size: 0.85rem;
    padding: 0.25em 0.3em;
  }

  pre {
    background: var(--xz-black);
    border-radius: 0.5rem;
    color: var(--xz-white);
    font-family: 'JetBrainsMono', monospace;
    margin: 1.5rem 0;
    padding: 0.75rem 1rem;

    code {
      background: none;
      color: inherit;
      font-size: 0.8rem;
      padding: 0;
    }
  }

  mark {
    background-color: #faf594;
    border-radius: 0.4rem;
    box-decoration-break: clone;
    padding: 0.1rem 0.3rem;
  }

  blockquote {
    background-color: var(--xz-secondbg);
    color: var(--xz-secondtext);
    border: var(--style-border-always);
    border-radius: 8px;
    margin: 1rem 0px;
    padding: 0.5rem 0.8rem;
  }

  hr {
    border: none;
    border-top: 1px solid var(--gray-2);
    margin: 2rem 0;
  }

  ul,
  ol {
    p {
      font-weight: bold;
    }
  }
}

/* 标题 */
.ProseMirror h1 {
  font-size: 2em;
  font-weight: bold;
  margin: 0.67em 0;
}

.ProseMirror h2 {
  font-size: 1.5em;
  font-weight: bold;
  margin: 0.83em 0;
}

.ProseMirror h3 {
  font-size: 1.17em;
  font-weight: bold;
  margin: 1em 0;
}

/* 段落 */
.ProseMirror p {
  line-height: 1.6;
  margin-bottom: 0.2em;
  color: var(--xz-fontcolor);
}

/* 加粗 */
.ProseMirror strong {
  font-weight: bold;
}

/* 斜体 */
.ProseMirror em {
  font-style: italic;
}

/* 行内代码 */
.ProseMirror code {
  font-family: monospace;
  color: var(--xz-white);
  line-height: 2;
  box-shadow: var(--xz-shadow-border);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  margin: 0px 4px;
  background: var(--xz-pink);
}

/* 无序列表和有序列表 */
.ProseMirror ul,
.ProseMirror ol {
  margin-top: 0.4rem;
  list-style: none;
  counter-reset: li 0;
  position: relative;
}

.ProseMirror ol li,
.ProseMirror ul li {
  padding: 0.1em 0.2em 0.1em 1em;
  position: relative;
  margin: 0.1rem 0;
}

.ProseMirror ul li::before,
.ProseMirror ol li::before {
  position: absolute;
  color: var(--xz-fontcolor);
  transition: all 0.3s ease-out 0s;
  margin: 0;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0.42em;
  height: 0.42em;
  border-radius: 0.42em;
  content: '';
  line-height: 0.42em;
  border: 0.21em solid var(--xz-lighttext);
  background: var(--xz-lighttext);
}

/* 代码块 */
.ProseMirror pre {
  border-radius: 4px;
  overflow: auto;
  line-height: 1.6;
  margin: 0;
  padding: 8px 0.5rem;
  color: var(--xz-secondtext);
  background: var(--xz-secondbg);
  border: var(--style-border-always);
}

/* 分隔线 */
.ProseMirror hr {
  border: none;
  border-top: 1px solid #ccc;
  margin: 1em 0;
}

/* 链接 */
.ProseMirror a {
  text-decoration: none;
  border-bottom: 2px dotted var(--xz-lighttext);
  color: var(--xz-fontcolor);
  font-weight: 700;
  padding: 0 4px;
  border-radius: 4px 4px 0 0;
  transition: all 0.3s ease;
  cursor: pointer;

  &:hover {
    color: var(--xz-white);
    border-radius: 4px;
    background: var(--xz-main);
  }
}
